<template>
  <div class="page">
    <div class="pc-tool">
      <el-tooltip
          :offset="22"
          :show-arrow="false"
          popper-class="tool-tooltip"
          effect="light"
          placement="right"
          content="Home">
        <div class="tool-icon home" @click="routerJump('/home')"></div>
      </el-tooltip>
      <div class="tool-line"></div>
      <el-tooltip :offset="22"
                  :show-arrow="false"
                  popper-class="tool-tooltip"
                  effect="light"
                  placement="right"
                  content="NEW chat">
        <div class="tool-icon new-chat" @click="routerJump('/chat/message')"></div>
      </el-tooltip>
      <el-tooltip  :offset="22"
                   :show-arrow="false"
                   popper-class="tool-tooltip"
                   effect="light"
                   placement="right"
                   content="History">
        <div class="tool-icon history" @click="routerJump('/chat/history')"></div>
      </el-tooltip>
      <div class="tool-line"></div>
      <el-tooltip  :offset="22"
                   :show-arrow="false"
                   popper-class="tool-tooltip"
                   effect="light"
                   placement="right"
                   content="Business">
        <div class="tool-icon business"></div>
      </el-tooltip>
      <el-tooltip  :offset="22"
                   :show-arrow="false"
                   popper-class="tool-tooltip"
                   effect="light"
                   placement="right"
                   content="News">
        <div class="tool-icon news"></div>
      </el-tooltip>
    </div>
    <router-view :key="$route.fullPath"/>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const routerJump = (path, type = 'replace') => {
  router[type]({
    path: path
  });
};
</script>
<style lang="scss">
.desktop {
  .page {
    position: relative;
    height: 100%;
    background-image: url("~@/assets/news/网页背景页.png");
    background-size: cover;
  }

  .pc-tool {
    width: 60px;
    background: #FAFBFF;
    border-radius: 8px;
    transform: translateY(-50%);
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 101;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 36px 0 20px 0;
    transition: all .3s ease;
    box-shadow: 2px 2px 7.7px 0px rgba(146, 159, 202, 0.19), 0px 0px 1px 1px rgba(255, 255, 255, 0.45) inset;
    .tool-icon {
      width: 32px;
      height: 32px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      cursor: pointer;
      margin-bottom: 16px;
      &.home {
        background-image: url("~@/assets/news/web-home.png");
      }
      &.new-chat {
        background-image: url("~@/assets/news/new_chat.png");
        &:hover {
          background-image: url("~@/assets/news/new_chat_active.png");
        }
      }
      &.history {
        background-image: url("~@/assets/news/history.png");
        &:hover {
          background-image: url("~@/assets/news/history_active.png");
        }
      }
      &.business {
        background-image: url("~@/assets/news/business.png");
        &:hover {
          background-image: url("~@/assets/news/business_active.png");
        }
      }
      &.news {
        background-image: url("~@/assets/news/news.png");
        &:hover {
          background-image: url("~@/assets/news/news_active.png");
        }
      }
    }
    .tool-line {
      width: 24px;
      height: 1px;
      background-color: #E5E5E5;
      border-radius: 12px;
      margin-bottom: 16px;
      cursor: pointer;
    }
  }
  .tool-tooltip.el-popper.is-light {
    border: none;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 15px 48px 0 rgba(16,16,16,0.06);
    width: 112px;
    height: 38px;
    padding: 0;
    line-height: 38px;
    font-size: 16px;
    color: #000000;
    text-align: center;
    font-family: PingFangSC-Regular;
  }
}
</style>
